package com.example.orderapi.api;

import com.example.orderapi.dto.OrderDto;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author
 * @date 2021-4-16 10:16
 */
public interface IOrderService {
    /**
     * 根据ID查询
     * @param orderId
     * @return
     */
    @GetMapping(value = "/orders/{orderId}")
    OrderDto queryByOrderId(@PathVariable("orderId") Integer orderId);

    /**
     * 创建
     * @param orderDto
     * @return
     */
    @PostMapping(value = "/orders")
    int create(@RequestBody OrderDto orderDto);
}
